<?php

namespace app\admin\model;

use think\Model;


class About extends Model
{


    // 表名
    protected $name = 'about';

    // 自动写入时间戳字段
    protected $autoWriteTimestamp = 'int';

    // 定义时间戳字段名
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';
    protected $deleteTime = false;

    // 追加属性
    protected $append = [
        'image_one_url',
        'image_two_url',
        'image_three_url',
        'image_four_url',
        'qrcode_one_url',
        'qrcode_two_url',
        'qrcode_three_url',
        'qrcode_four_url',
    ];


    public function getImageOneUrlAttr($value, $data)
    {
        return isset($data['image_one']) && !empty($data['image_one']) ? cdnurl($data['image_one'], true) : '';
    }

    public function getImageTwoUrlAttr($value, $data)
    {
        return isset($data['image_two']) && !empty($data['image_two']) ? cdnurl($data['image_two'], true) : '';
    }

    public function getImageThreeUrlAttr($value, $data)
    {
        return isset($data['image_three']) && !empty($data['image_three']) ? cdnurl($data['image_three'], true) : '';
    }

    public function getImageFourUrlAttr($value, $data)
    {
        return isset($data['image_four']) && !empty($data['image_four']) ? cdnurl($data['image_four'], true) : '';
    }

    public function getQrcodeOneUrlAttr($value, $data)
    {
        return isset($data['qrcode_one']) && !empty($data['qrcode_one']) ? cdnurl($data['qrcode_one'], true) : '';
    }

    public function getQrcodeTwoUrlAttr($value, $data)
    {
        return isset($data['qrcode_two']) && !empty($data['qrcode_two']) ? cdnurl($data['qrcode_two'], true) : '';
    }

    public function getQrcodeThreeUrlAttr($value, $data)
    {
        return isset($data['qrcode_three']) && !empty($data['qrcode_three']) ? cdnurl($data['qrcode_three'], true) : '';
    }

    public function getQrcodeFourUrlAttr($value, $data)
    {
        return isset($data['qrcode_four']) && !empty($data['qrcode_four']) ? cdnurl($data['qrcode_four'], true) : '';
    }


}
